<include file="Common:header" />
<!-- /. NAV SIDE  -->
<include file="Common:left" />
<!-- /. NAV SIDE  -->
<div id="page-wrapper">
	<div class="header">
		<h1 class="page-header">
			商品管理 <small>Welcome {$Think.config.system_tag}</small>
		</h1>
		<ol class="breadcrumb">
			<li><a href="{:U('Index/index')}">首页</a></li>
			<li class="active">商品列表</li>
			<div style="float:right"><a href="{:U('Goods/addGoods',array('type'=>3))}">添加商品</a></div>
		</ol> 
	</div>
	<div id="page-inner">
		<div class="row">
			<div class="col-xs-12">
				<!--Search content-->
				<div class="panel panel-default" style="margin-bottom:0px; border-bottom:none">
					<div class="panel-body">
						<form class="layui-form" action="{:U('Goods/goodsList')}" method="post">
							<div class="layui-form-item">
								<label class="layui-form-label" style="width:auto;">名称</label>
								<div class="layui-input-inline">
									<input value="{$filter.goods_title}" type="text" name="goods_title" placeholder="请输入名称" autocomplete="off" class="layui-input">
								</div>
								<label class="layui-form-label" style="width:auto;">货号</label>
								<div class="layui-input-inline">
									<input value="{$filter.bn}" type="text" name="bn" placeholder="请输入货号" autocomplete="off" class="layui-input">
								</div>
                        		<label class="layui-form-label" style="width:auto;">分类</label>
								<div class="layui-input-inline">
									<select name="cate_id" lay-verify="">
										<option value="">请选择</option>
										<notempty name="goodsCateList">
											<volist name="goodsCateList" id="vo">
												<option value="{$vo.id}" <if condition="$filter['cate_id'] eq $vo['id']">selected</if>>{$vo.cate_name}</option>
												<if condition="isset($vo['second_list'])">
													<assign name="secondList" value="$vo['second_list']" />
													<volist name="secondList" id="v">
														<option value="{$v.id}" <if condition="$filter['cate_id'] eq $v['id']">selected</if>> &nbsp;&nbsp;&nbsp;{$v.cate_name}</option>
													</volist>
												</if>
											</volist>
										</notempty>
									</select>
								</div>
                                <label class="layui-form-label" style="width:auto;">是否推荐</label>
								<div class="layui-input-inline">
									<select name="is_recommend" lay-verify="">
										<option value="">请选择</option>
										<notempty name="recommendList">
											<volist name="recommendList" id="vo">
												<option value="{$vo.id}" <if condition="isset($filter['is_recommend'])&&($filter['is_recommend'] eq $vo['id'])">selected</if>>{$vo.name}</option>
												</li>
											</volist>
										</notempty>
									</select>
								</div>
								<div class="layui-input-inline" style="width:auto;">
									<button type="submit" class="btn btn-default">搜索</button>
								</div>
							</div>
						</form>
					</div>
				</div>
				<!--Search content-->
				<!--Formlist content-->
				<div class="panel panel-default">
					<div class="panel-body">
						<div class="table-responsive">
							<table class="table table-hover">
								<thead>
									<tr>
										<th>序号</th>
										<th>货号</th>
										<th>分类</th>
										<th>商品名称</th>
										<th>可用库存</th>
										<th>排序</th>
                                        <th>是否新品</th>
                                        <th>是否热卖</th>
										<th>状态</th>
										<th>操作</th>
									</tr>
								</thead>
								<tbody>
									<volist name="list" id="vo">
										<tr>
											<td style="line-height:30px">{$vo.id}</td>
											<td style="line-height:30px">{$vo.bn}</td>
											<td style="line-height:30px">{$vo.cate_name}</td>
											<td style="line-height:30px">[{$vo.id}]{$vo.goods_title}</td>
											<td style="line-height:30px">{$vo.goods_stock}</td>
											<td style="line-height:30px">{$vo.sort}</td>
                                            <td style="line-height:30px">{$vo.is_new}</td>
                                            <td style="line-height:30px">{$vo.is_hot}</td>
											<td style="line-height:30px">
											<if condition="$vo.status eq 1">
											上架
											<else />
											下架
											</if>
											</td>
											<td style="line-height:30px">
											<a href="{:U('Goods/editGoods',array('id'=>$vo['id']))}" class="layui-btn layui-btn-xs layui-btn-normal">编辑</a><a href="javascript:void(0)" class="layui-btn layui-btn-xs layui-btn-normal" onclick="openlayer('修改','{:U('Goods/updateGoodStocks',array('id'=>$vo['id']))}');return false;">入库</a>
    											<if condition="$vo['status'] eq 1">
    											<a href="javascript:void(0)" class="layui-btn layui-btn-danger layui-btn-xs layui-btn-normal" onclick="ajaxConfirm('确定要下架吗?','{:U('Goods/operatorGoods',array('id'=>$vo['id'],'status'=>0))}')">下架</a>
    											<else />
    											<a href="javascript:void(0)" class="layui-btn layui-btn-xs layui-btn-normal" onclick="ajaxConfirm('确定要上架吗?','{:U('Goods/operatorGoods',array('id'=>$vo['id'],'status'=>1))}')">上架</a>
    											</if>
											</td>
										</tr>
									</volist>
								</tbody>
							</table>
							{$page}
						</div>
					</div>
				</div>
				<!--Formlist content-->
			</div>
		</div>
	</div>
	<include file="Common:foot" />
	<script>
		layui.use('form', function(){
		  var form = layui.form;
		});
	</script>
	 <!-- /. PAGE INNER  -->
</div>
<include file="Common:footer" />
    